#!/bin/sh

for i in $PLIBDIRS # $PLIBDIRS is exported in 2createpackages
do
	[ -d $i ] || continue
	if [ -e ${i}/libtiff.so.6 ] ; then
		ln -sv libtiff.so.6 ${i}/libtiff.so.3
		ln -sv libtiff.so.6 ${i}/libtiff.so.4
		ln -sv libtiff.so.6 ${i}/libtiff.so.5
	elif [ -e ${i}/libtiff.so.4 ] ; then
		ln -sv libtiff.so.5 ${i}/libtiff.so.3
		ln -sv libtiff.so.5 ${i}/libtiff.so.4
	elif [ -e ${i}/libtiff.so.5 ] ; then
		ln -sv libtiff.so.4 ${i}/libtiff.so.3
	fi
done

#============================================
# delete only a few apps..

# slacko: libtiff
# ubuntu/debian: libtiff-tools

# peasyscan_pdf_plugin-1.1-1/
# peasyscan_pdf_plugin-1.1-1/usr/bin/tiff2pdf
# peasyscan_pdf_plugin-1.1-1/usr/bin/ppm2tiff

apps='tiffcrop
tiff2ps
tiffcp
raw2tiff
tiffmedian
tiffcmp
thumbnail'

for i in $apps
do
	[ -f usr/bin/${i} ] || continue
	rm -fv usr/bin/${i}
done
